<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%--引入标签--%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>预约信息</title>

    <!-- jquery -->
    <script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
    <!-- Bootstrap -->
    <link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-12" align="center;">
            <h2>预约详细信息</h2>
        </div>
    </div>
    <div class="row">
        <div class="col-md-2 offset-md-10">
            <button class="btn btn-primary btn-sm">添加</button>
            <button class="btn btn-danger btn-sm">删除</button>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <table class="table table-hover">
                <tr>
                    <th>预约号</th>
                    <th>预约时间</th>
                    <th>医院</th>
                    <th>科室</th>
                    <th>医生姓名</th>
                    <th>患者姓名</th>
                    <th>患者性别</th>
                    <th>患者联系方式</th>
                    <th>操作</th>
                </tr>
                <c:forEach items="${pageInfo.list}" var="orders">


                    <tr>
                        <th>${orders.id}</th>
                        <th>${orders.orderDate}</th>
                        <th>华西医院</th>
                        <th>内科</th>
                        <th>张三</th>
                        <th>患者甲</th>
                        <th>男</th>
                        <th>1355637824565
                        </th>
                        <th>



                    <%--<tr>
                        <th>${orders.id}</th>
                        <th>${orders.orderDate}</th>
                        <th>${orders.doctor.dHospital}</th>
                        <th>${orders.doctor.dDepartment}</th>
                        <th>${orders.doctor.dName}</th>
                        <th>${orders.patient.pName}</th>
                        <th>${orders.patient.pGender=="m"?"男":"女"}</th>
                        <th>${orders.patient.pPhone}</th>
                        <th>--%>
                            <button class="btn btn-primary btn-sm">
                                <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                                修改
                            </button>
                            <button class="btn btn-danger btn-sm">
                                <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>
                                修改
                            </button>
                        </th>
                    </tr>
                </c:forEach>
            </table>
        </div>
    </div>
    <div class="row">
        <div class="col-md-6">
            第${pageInfo.pageNum}页，共${pageInfo.pages}页，共${pageInfo.total}条记录
        </div>
        <div class="col-md-6 offset-md-4">
            <nav aria-label="Page navigation example">
                <ul class="pagination pagination-sm">
                    <li class="page-item"><a class="page-link" href="${pageContext.request.contextPath}/orders?page=1">首页</a></li>
                    <c:if test="${pageInfo.hasPreviousPage}">
                        <li class="page-item"><a class="page-link"
                                                 href="${pageContext.request.contextPath}/orders?page=${pageInfo.pageNum-1}">上一页</a></li>
                    </c:if>
                    <c:forEach items="${pageInfo.navigatepageNums}" var="page">
                        <c:if test="${page==pageInfo.pageNum}">
                            <li class="page-item active"><a class="page-link" href="#">${page}</a></li>
                        </c:if>
                        <c:if test="${page!=pageInfo.pageNum}">
                            <li class="page-item"><a class="page-link"
                                                     href="${pageContext.request.contextPath}/orders?page=${page}">${page}</a></li>
                        </c:if>
                    </c:forEach>
                    <c:if test="${pageInfo.hasNextPage}">
                        <li class="page-item"><a class="page-link"
                                                 href="${pageContext.request.contextPath}/orders?page=${pageInfo.pageNum+1}">下一页</a></li>
                    </c:if>
                    <li class="page-item"><a class="page-link" href="${pageContext.request.contextPath}/orders?page=${pageInfo.pages}">末页</a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</div>

</body>
</html>

